import tkinter
import test_tkinter
import packet
import des2
import rsa2
publicKey, privateKey = rsa2.newkeys(128)
sessionKey = des2.newkey()
a = tkinter.Tk()
M = test_tkinter.PacketInterface(a)
# 按钮功能失效
A = packet.get_pack('c_a', 'none', 'unknown1', '127.0.0.1', '127.0.0.1', sessionkey=sessionKey,
                  privatekey=privateKey, content='3futu325fcn')
# P = pack(A.get_sec_packet(), sessionKey, publicKey)
P = packet.pack(A, sessionkey=sessionKey, publickey=publicKey)
# print(P)
print('>>>>')
M.send_show('c_s', 'business', 'unknown2', 214,  '127.0.0.1', '127.0.0.1', sessionkey=sessionKey,                      privatekey=privateKey,
                           content='3futu325fcn' * 9)
# M.send_show('c_s', 'business', 'unknown2', '127.0.0.1', '127.0.0.1', sessionkey=sessionKey,
#                        privatekey=privateKey, content='3futu325fcn' * 20)
M.recv_show(P)
a.mainloop()

